import { prop_cur_req_user_identity } from '../../../../../../../../../Classes/cla_req_cur_headers_info';
import { req_cur_user_delete_uni_float_info } from '../Classes/cla_req_cur_user_delete_uni_float_info';
import { get_mdb_user_uni_float_identity_type_active } from '../../../DataDefine/get_mdb';

export async function sign_out_cur_user_uni_float_identity_type_active(
  uni_float_info: req_cur_user_delete_uni_float_info
) {
  let delete_id_arr: string[] = [];
  /**
   * 创建 类型 的 用户 浮动元素 身份 表
   */
  let mdb_cur_user_uni_float_identity_type_active =
    get_mdb_user_uni_float_identity_type_active(
      uni_float_info[prop_cur_req_user_identity]
    );

  for (const cur_delete_uni_float_id of uni_float_info.delete_uni_float_arr) {
    let delete_id = await mdb_cur_user_uni_float_identity_type_active.deleteOne(
      {
        id: cur_delete_uni_float_id,
      }
    );

    if (delete_id.deletedCount == 1) {
      delete_id_arr.push(cur_delete_uni_float_id);
    }
  }
  return delete_id_arr;
}
